/*
 * Filename:    AuditSurveyReviewDao.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-11-14
 */
package com.paic.mhis.hcpms.audit.dao;

import java.util.List;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.audit.dto.AuditProblemsDTO;
import com.paic.mhis.hcpms.audit.dto.AuditTargetDTO;
import com.paic.mhis.hcpms.audit.dto.AuditiCaseDTO;
import com.paic.pafa.biz.dao.BaseDAO;

@Component("auditSurveyReviewDao")
public class AuditSurveyReviewDao extends BaseDAO {

	/**
	 * 更新案件对象
	 * 
	 * @param bean
	 */
	public void updateAuditTargetInfo(AuditTargetDTO bean) {
		this._update("auditSurveyReview.updateAuditTargetInfo", bean);
	}

	/**
	 * 保存事件对象
	 * 
	 * @param bean
	 */
	public void saveAuditProblemsDTO(AuditProblemsDTO bean) {
		this._insert("auditSurveyReview.insertAuditProblemsDetail", bean);

	}

	/**
	 * 插入案件信息
	 * 
	 * @param bean
	 */
	public void saveAuditCaseDTO(AuditiCaseDTO bean) {

		this._insert("auditSurveyReview.insertAuditiCaseDTO", bean);

	}

	public AuditiCaseDTO loadAuditiCaseDTOByCode(AuditiCaseDTO bean) {

		AuditiCaseDTO queryBean = (AuditiCaseDTO) this._queryForObject(
				"audticase.loadAuditCaseByCaseCode", bean);
		return queryBean;
	}

	/**
	 * 查询事件对象
	 * 
	 * @param bean
	 * @return
	 */
	public AuditProblemsDTO queryAuditProblemsDTO(AuditProblemsDTO bean) {
		List<AuditProblemsDTO> list = (List<AuditProblemsDTO>) this
				._queryForList("auditSurveyReview.queryAuditProblemsDetail",
						bean);
		if (list != null && list.size() > 0) {
			return list.get(0);
		} else {
			return null;
		}
	}

	/**
	 * 插入稽核对象表
	 * 
	 * @param bean
	 */
	public void insertAuditTargetDTO(AuditTargetDTO bean) {

		this._insert("auditSurveyReview.insertAuditTarget", bean);

	}

	/**
	 * 删除稽核对象
	 * 
	 * @param bean
	 */
	public void deleteAuditTarget(AuditTargetDTO bean) {
		this._delete("auditSurveyReview.deleteAuditTarget", bean);

	}

	/**
	 * 查询稽核对象表
	 * 
	 * @param bean
	 * @return
	 */
	public List<AuditTargetDTO> queryAuditTargetDTO(AuditTargetDTO bean) {
		List<AuditTargetDTO> list = (List<AuditTargetDTO>) this._queryForList(
				"auditSurveyReview.queryAuditTargetList", bean);
		return list;
	}
}
